﻿<%@ Page EnableEventValidation="false" Language="C#" AutoEventWireup="true" Inherits="cp_member_favourite" Codebehind="favourite.aspx.cs" %>
<%@ Register TagPrefix="obout" Namespace="Obout.Grid" Assembly="obout_Grid_NET" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <script type="text/javascript" src="/JavaScripts/jquery-1.3.2.js">
    </script>
    <script type="text/javascript">
        $("document").ready(function() {
            $("#btnOpenEditField").bind("click", function() {
                $("#div1").toggle("fast");
                });
            });

            function grid1_OnBeforeDelete(record) {
                return confirm("Bạn có chắc chắn là muốn xóa record này không?");
            }
    </script>
    <title></title>
    <style type="text/css">
        #div1
        {
            left: 10px;
            position: absolute;
        }
    </style>
</head>
<body>
    <form id="form1" runat="server">
    <obout:Grid 
            runat="server" ID="grid1" AutoGenerateColumns="false"
		    FolderStyle="/App_Themes/E2GroupTheme/obout/styles/style_4" 
		    AllowAddingRecords="false" 
		    AllowColumnResizing = "true"
		    AllowRecordSelection = "false"
		    AllowSorting = "true"
		    ondeletecommand="Grid1_DeleteCommand"
		    OnRebind="Grid1_Rebind"
		    >
        <Columns>
            <obout:Column DataField="idSanPham" Visible="false"></obout:Column>
            <obout:Column DataField="TenSanPham" HeaderText="Tên sản phẩm" Width = "225" Wrap="true" Align="center"></obout:Column>
            <obout:Column DataField="Url" HeaderText="Hình ảnh" Width="100" Align="center" Wrap = "true">
                <TemplateSettings TemplateID="ImageTemplate" />
            </obout:Column>
            <obout:Column DataField="MauSac" HeaderText="Màu sắc" Width="90" Wrap = "true" Align="center"></obout:Column>
            <obout:Column DataField="Gia" HeaderText="Giá bán" Width="120" Wrap = "true" Align="center">
                <TemplateSettings TemplateId="GiaTienTemplate" />
            </obout:Column>
            <obout:Column ID="Xoa" DataField="" HeaderText="Xóa" Width="90" AllowDelete="true" Visible="true" Wrap ="true" Align="center" runat="server">
                    <TemplateSettings TemplateID="DeleteTemplate"/>
            </obout:Column>
        </Columns>
        <ClientSideEvents 
                OnBeforeClientDelete = "grid1_OnBeforeDelete"/>
        <ScrollingSettings ScrollHeight="520" ScrollWidth = "510"/>
        <Templates>
	        <obout:GridTemplate runat="server" ID="ImageTemplate">
		        <Template>
		            <a href = "javascript:parent.location.href='/Products/detail.aspx?ProductId=<%# Container.DataItem["idSanPham"]%>';" style="outline:none">
		            <img src="/images/HinhAnhSanPham/<%# Container.DataItem["Url"] %>" alt="" width="50" height="50" border="0" />
                    </a>
                </Template>
	        </obout:GridTemplate>
	        <obout:GridTemplate runat="server" ID="GiaTienTemplate">
	            <Template>
	                <%# E2_WEBSITE.Code.Utilities.ConvertToMoneyFormat(int.Parse(Container.Value.ToString()), true)%>
	            </Template>
            </obout:GridTemplate>
            <obout:GridTemplate runat="server" ID="DeleteTemplate">
                <Template>
                    <a href="javascript:" style="outline:none">
                        <img id="imgDeleteBasket" src="/images/Button/Delete.png" alt="" onclick='grid1.delete_record(this);' width="50" height="25" style="border-style: none"/>
                    </a>
                </Template>
            </obout:GridTemplate>
        </Templates>
        
        <MasterDetailSettings LoadingMode="OnCallback" />
        <DetailGrids>
        </DetailGrids>
    </obout:Grid>
    </form>
</body>
</html>